SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW [dbo].[vwSubServiciosAgentesSF]
AS
SELECT        dbo.tb_SubserviciosAgentes.idSubServicio, dbo.tb_SubserviciosAgentes.ServicioAgente, dbo.tb_SubserviciosAgentes.FechaAlta, dbo.tb_SubserviciosAgentes.Baja, 
                         dbo.tb_SubserviciosAgentes.FechaBaja, dbo.vwrPlazasSF.Descripcion AS CUPOF, dbo.vwrPlazasSF.CUISE, dbo.vwrPlazasSF.ID AS IdPlaza, 
                         dbo.vwrPlazasSF.Organizacion, dbo.tb_SubserviciosAgentes.Licencia, dbo.tb_SubserviciosAgentes.CodEnfermedad, 
                         dbo.vwrSituacionesLaborales.Mnemo AS SituacionLaboral, dbo.vwrSituacionesExtraordinarias.Mnemo AS SituacionExtraordinaria, 
                         dbo.vwrNivelesEnsenanza.ID AS IdNivelEnsenanza, dbo.vwrNivelesEnsenanza.Descripcion AS NivelEnsenanza, 
                         dbo.vwrModalidadesEnsenanza.ID AS IdModalidadEnsenanza, dbo.vwrModalidadesEnsenanza.Descripcion AS ModalidadEnsenanza, 
                         dbo.tb_SubserviciosAgentes.FechaTermino, dbo.tb_SubserviciosAgentes.NroOrden9, dbo.vwrZonas.Descripcion AS Zona, 
                         dbo.vwrLicencias.Descripcion AS LicenciaDescripcion, dbo.tb_SubserviciosAgentes.confirmada, vwrNormas_2.Descripcion AS NormaInicio, 
                         vwrNormas_1.FechaDeCarga, vwrNormas_1.Descripcion AS NormaFin, dbo.vwrfunciones.Descripcion AS Funcion, dbo.vwrDivisiones.Curso, 
                         dbo.vwrDivisiones.Division, dbo.vwrTurnos.Descripcion AS Turno, dbo.vwrTurnos.Mnemo AS LetraTurno, dbo.tb_SubserviciosAgentes.Movimiento, 
                         vwrNormas_1.SeImprimio, dbo.tb_SubserviciosAgentes.SituacionLaboral AS IdSituacionLaboral, 
                         dbo.tb_SubserviciosAgentes.SituacionExtraordinaria AS IdSituacionExtraordinaria, dbo.vwrPlazasSF.RegimenSalarial AS IdRegimenSalarialPlaza, 
                         dbo.vwrEnfermedades.CodigoAlfanumerico
FROM            dbo.tb_SubserviciosAgentes LEFT OUTER JOIN
                         dbo.vwrPlazasSF ON dbo.tb_SubserviciosAgentes.Plaza = dbo.vwrPlazasSF.ID LEFT OUTER JOIN
                         dbo.vwrSituacionesLaborales ON dbo.tb_SubserviciosAgentes.SituacionLaboral = dbo.vwrSituacionesLaborales.ID LEFT OUTER JOIN
                         dbo.vwrSituacionesExtraordinarias ON dbo.tb_SubserviciosAgentes.SituacionExtraordinaria = dbo.vwrSituacionesExtraordinarias.ID LEFT OUTER JOIN
                         dbo.vwrNivelesEnsenanza ON dbo.tb_SubserviciosAgentes.Nivel = dbo.vwrNivelesEnsenanza.ID LEFT OUTER JOIN
                         dbo.vwrModalidadesEnsenanza ON dbo.tb_SubserviciosAgentes.Modalidad = dbo.vwrModalidadesEnsenanza.ID LEFT OUTER JOIN
                         dbo.vwrZonas ON dbo.tb_SubserviciosAgentes.Zona = dbo.vwrZonas.ID LEFT OUTER JOIN
                         dbo.vwrfunciones ON dbo.vwrPlazasSF.Funcion = dbo.vwrfunciones.ID LEFT OUTER JOIN
                         dbo.vwrDivisiones ON dbo.vwrPlazasSF.Division = dbo.vwrDivisiones.ID LEFT OUTER JOIN
                         dbo.vwrTurnos ON dbo.vwrPlazasSF.Turno = dbo.vwrTurnos.ID LEFT OUTER JOIN
                         dbo.vwrNormas AS vwrNormas_1 ON dbo.tb_SubserviciosAgentes.NormaFin = vwrNormas_1.ID LEFT OUTER JOIN
                         dbo.vwrNormas AS vwrNormas_2 ON dbo.tb_SubserviciosAgentes.NormaInicio = vwrNormas_2.ID LEFT OUTER JOIN
                         dbo.vwrLicencias ON dbo.tb_SubserviciosAgentes.Licencia = dbo.vwrLicencias.ID LEFT OUTER JOIN
                         dbo.vwrEnfermedades ON dbo.tb_SubserviciosAgentes.CodEnfermedad = dbo.vwrEnfermedades.ID


GO
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [CentroDeDesignaciones]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [Direcciones De Nivel]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [GestionInstitucional]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [Juntas]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [MCEEjecutivo]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [PersonalDocente]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [SoloVer]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [Subsidios]
GRANT SELECT ON  [dbo].[vwSubServiciosAgentesSF] TO [SubsidiosConsulta]
GO

EXEC sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[26] 4[5] 2[39] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -768
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tb_SubserviciosAgentes"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 135
               Right = 286
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrPlazasSF"
            Begin Extent = 
               Top = 15
               Left = 481
               Bottom = 144
               Right = 690
            End
            DisplayFlags = 280
            TopColumn = 5
         End
         Begin Table = "vwrSituacionesLaborales"
            Begin Extent = 
               Top = 270
               Left = 38
               Bottom = 382
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrSituacionesExtraordinarias"
            Begin Extent = 
               Top = 384
               Left = 38
               Bottom = 496
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrNivelesEnsenanza"
            Begin Extent = 
               Top = 498
               Left = 38
               Bottom = 593
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrModalidadesEnsenanza"
            Begin Extent = 
               Top = 594
               Left = 38
               Bottom = 706
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrZonas"
            Begin Extent = 
               Top = 708
               Left = 38
               Bott', 'USER', N'dbo', 'VIEW', N'vwSubServiciosAgentesSF', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPane2', N'om = 803
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrfunciones"
            Begin Extent = 
               Top = 804
               Left = 38
               Bottom = 916
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrDivisiones"
            Begin Extent = 
               Top = 918
               Left = 38
               Bottom = 1047
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrTurnos"
            Begin Extent = 
               Top = 1050
               Left = 38
               Bottom = 1162
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrNormas_1"
            Begin Extent = 
               Top = 1164
               Left = 38
               Bottom = 1293
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrNormas_2"
            Begin Extent = 
               Top = 1296
               Left = 38
               Bottom = 1425
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrLicencias"
            Begin Extent = 
               Top = 1428
               Left = 38
               Bottom = 1557
               Right = 263
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "vwrEnfermedades"
            Begin Extent = 
               Top = 1560
               Left = 38
               Bottom = 1672
               Right = 247
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'USER', N'dbo', 'VIEW', N'vwSubServiciosAgentesSF', NULL, NULL
GO
DECLARE @xp int
SELECT @xp=2
EXEC sp_addextendedproperty N'MS_DiagramPaneCount', @xp, 'USER', N'dbo', 'VIEW', N'vwSubServiciosAgentesSF', NULL, NULL
GO
